<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%
String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/page-tags" prefix="p" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>日志列表</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="content-type" content="text/html;charset=UTF-8">
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<jsp:include page="../common.jsp"/>
	<!-- 日期控件start -->
	<script type="text/javascript" src="<%=basePath%>libs/js/form/datePicker/WdatePicker.js"></script>
	<!-- 日期控件end -->
  </head>
  <body>
    <form action="sys/log/list" method="post">
	    <div class="box2" panelTitle="查询" id="searchPanel">
			<table>
				<tr>
					<td>开始时间:</td>
					<td>
						<fmt:formatDate value="${begin }" pattern="yyyy-MM-dd" var="begin"/>
						<input type="text" name="begin" value="${begin }" readonly="readonly" id="beginTime" class="dateIcon">
					</td>
					<td>结束时间:</td>
					<td>
						<fmt:formatDate value="${end }" pattern="yyyy-MM-dd" var="end"/>
						<input type="text" name="end" value="${end }" readonly="readonly" id="endTime" class="dateIcon">
					</td>
					<td><button><span class="icon_find">查询</span></button>
					<input type="button" class="button" value="统计" onclick="location.href='sys/log/query'"></td>
				</tr>
			</table>
		</div>
    </form>
    <div id="scrollContent"  class="padding_top5" style="overflow-x:hidden;">
		<table class="tableStyle" mode="list" fixedCellHeight="true">
	    	<tr>
	    		<th>序号</th>
	    		<th>访问者</th>
	    		<th>访问者IP</th>
	    		<th>访问URL</th>
	    		<th>请求参数</th>
	    		<th>访问时间</th>
	    		<th>处理用时</th>
	    		<th>处理结果</th>
	    	</tr>
	    	<c:forEach items="${page.content}" var="i" varStatus="s">
	    	<tr>
	    		<td>${s.count}</td>
	    		<td>${i.loginUser}</td>
	    		<td>${i.ipAddress}</td>
	    		<td>${i.requestUrl}</td>
	    		<td>${i.queryString}</td>
	    		<td>${i.accessTime}</td>
	    		<td>${i.processTime}毫秒</td>
	    		<td>${i.processResult}</td>
	    	</tr>
	    	</c:forEach>
	    </table>
	</div>
    <div style="height:35px;">
		<div class="float_left padding5"></div>
		<div class="float_right padding5">
			<p:page pager="${page }">
				<p:param name="begin" value="${begin }"/>
				<p:param name="end" value="${end }"/>
			</p:page>
		</div>
		<div class="clear"></div>
	</div>
	<script>
		$(function () {
			$("#beginTime").click(function(){
				WdatePicker({
					maxDate:"#F{$dp.$D('endTime')||'${now}'}"
				});
			});
			$("#endTime").click(function(){
				WdatePicker({
					maxDate:"%y-%M-%d",minDate:"#F{$dp.$D('beginTime')}"
				});
			});
	    });
	</script>
  </body>
</html>